home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / abstyles / anotit.bst < prev    next >
Text File  |  1992-05-24  |  18KB  |  1,075 lines

  1. % BibTeX bibliography style `ANOTIT'
  2. ENTRY
  3. { address
  4. author
  5. booktitle
  6. chapter
  7. edition
  8. editor
  9. howpublished
  10. institution
  11. journal
  12. key
  13. month
  14. note
  15. number
  16. organization
  17. pages
  18. publisher
  19. school
  20. series
  21. title
  22. type
  23. volume
  24. year
  25. }
  26. {}
  27. { label }
  28. INTEGERS { output.state before.all mid.sentence after.sentence after.block 
  29. continue.sentence }
  30. FUNCTION {init.state.consts}
  31. { #0 'before.all :=
  32. #1 'mid.sentence :=
  33. #2 'after.sentence :=
  34. #3 'after.block :=
  35. #4 'continue.sentence :=
  36. }
  37. STRINGS { s t }
  38. FUNCTION {output.nonnull}
  39. { 's :=
  40. output.state continue.sentence =
  41. { " " * write$ }
  42. { output.state mid.sentence =
  43. { ", " * write$ }
  44. { output.state after.block =
  45. { add.period$ write$
  46. newline$
  47. "\newblock " write$
  48. }
  49. { output.state before.all =
  50. 'write$
  51. { add.period$ " " * write$ }
  52. if$
  53. }
  54. if$
  55. }
  56. if$
  57. continue.sentence 'output.state :=
  58. }
  59. if$
  60. s
  61. }
  62. FUNCTION {output}
  63. { duplicate$ empty$
  64. 'pop$
  65. 'output.nonnull
  66. if$
  67. }
  68. FUNCTION {output.check}
  69. { 't :=
  70. duplicate$ empty$
  71. { pop$ "empty " t * " in " * cite$ * warning$ }
  72. 'output.nonnull
  73. if$
  74. }
  75. FUNCTION {output.bibitem}
  76. { newline$
  77. "\bibitem{" write$
  78. cite$ write$
  79. "}" write$
  80. newline$
  81. ""
  82. before.all 'output.state :=
  83. }
  84. FUNCTION {fin.entry}
  85. { add.period$
  86. write$
  87. newline$
  88. }
  89. FUNCTION {new.block}
  90. { output.state before.all =
  91. 'skip$
  92. { after.block 'output.state := }
  93. if$
  94. }
  95. FUNCTION {new.sentence}
  96. { output.state after.block =
  97. 'skip$
  98. { output.state before.all =
  99. 'skip$
  100. { after.sentence 'output.state := }
  101. if$
  102. }
  103. if$
  104. }
  105. FUNCTION {new.clause}
  106. { output.state after.sentence =
  107. 'skip$
  108. { output.state after.block =
  109. 'skip$
  110. { output.state before.all =
  111. 'skip$
  112. { mid.sentence 'output.state := }
  113. if$
  114. }
  115. if$
  116. }
  117. if$
  118. }
  119. FUNCTION {not}
  120. {   { #0 }
  121. { #1 }
  122. if$
  123. }
  124. FUNCTION {and}
  125. {   'skip$
  126. { pop$ #0 }
  127. if$
  128. }
  129. FUNCTION {or}
  130. {   { pop$ #1 }
  131. 'skip$
  132. if$
  133. }
  134. FUNCTION {new.block.checka}
  135. { empty$
  136. 'skip$
  137. 'new.block
  138. if$
  139. }
  140. FUNCTION {new.block.checkb}
  141. { empty$
  142. swap$ empty$
  143. and
  144. 'skip$
  145. 'new.block
  146. if$
  147. }
  148. FUNCTION {new.sentence.checka}
  149. { empty$
  150. 'skip$
  151. 'new.sentence
  152. if$
  153. }
  154. FUNCTION {new.sentence.checkb}
  155. { empty$
  156. swap$ empty$
  157. and
  158. 'skip$
  159. 'new.sentence
  160. if$
  161. }
  162. FUNCTION {new.clause.checka}
  163. { empty$
  164. 'skip$
  165. 'new.clause
  166. if$
  167. }
  168. FUNCTION {new.clause.checkb}
  169. { empty$
  170. swap$ empty$
  171. and
  172. 'skip$
  173. 'new.clause
  174. if$
  175. }
  176. FUNCTION {field.or.null}
  177. { duplicate$ empty$
  178. { pop$ "" }
  179. 'skip$
  180. if$
  181. }
  182. FUNCTION {emphasize}
  183. { duplicate$ empty$
  184. { pop$ "" }
  185. { "\abtype{2}{" swap$ * "}" * }    
  186. if$
  187. }
  188. FUNCTION {capitalize}
  189. { duplicate$ empty$
  190. { pop$ "" }
  191. { "\abtype{0}{" swap$ * "}" * }    
  192. if$
  193. }
  194. FUNCTION {boldface}
  195. { duplicate$ empty$
  196. { pop$ "" }
  197. { "\abtype{3}{" swap$ * "}" * }    
  198. if$
  199. }
  200. FUNCTION {quote}
  201. { duplicate$ empty$
  202. { pop$ "" }
  203. { "\abtype{1}{" swap$ * "}" * }    
  204. if$
  205. }
  206. FUNCTION {parentheses}
  207. { duplicate$ empty$
  208. { pop$ "" }
  209. { "\abtype{5}{" swap$ * "}" * }    
  210. if$
  211. }
  212. INTEGERS { nameptr namesleft numnames }
  213. FUNCTION {format.names}
  214. { 's :=
  215. #1 'nameptr :=
  216. s num.names$ 'numnames :=
  217. numnames 'namesleft :=
  218. { namesleft #0 > }
  219. { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
  220. nameptr #1 >
  221. { namesleft #1 >
  222. { ", " * t * }
  223. { numnames #2 >
  224. { "\abphrase{1}" * }    
  225. 'skip$
  226. if$
  227. t "others" =
  228. { "\abphrase{2}" * }        
  229. { "\abphrase{0}" * t * }    
  230. if$
  231. }
  232. if$
  233. }
  234. 't
  235. if$
  236. nameptr #1 + 'nameptr :=
  237. namesleft #1 - 'namesleft :=
  238. }
  239. while$
  240. }
  241. FUNCTION {format.authors}
  242. { author empty$
  243. { "" }
  244. { author format.names capitalize }
  245. if$
  246. }
  247. FUNCTION {format.editors}
  248. { editor empty$
  249. { "" }
  250. { editor format.names capitalize
  251. editor num.names$ #1 >
  252. { "\abphrase{3}" * }    
  253. { "\abphrase{4}" * }    
  254. if$
  255. }
  256. if$
  257. }
  258. FUNCTION {format.title}
  259. { title empty$
  260. { "" }
  261. { title "t" change.case$ }
  262. if$
  263. }
  264. FUNCTION {n.dashify}
  265. { 't :=
  266. ""
  267. { t empty$ not }
  268. { t #1 #1 substring$ "-" =
  269. { t #1 #2 substring$ "--" = not
  270. { "--" *
  271. t #2 global.max$ substring$ 't :=
  272. }
  273. {   { t #1 #1 substring$ "-" = }
  274. { "-" *
  275. t #2 global.max$ substring$ 't :=
  276. }
  277. while$
  278. }
  279. if$
  280. }
  281. { t #1 #1 substring$ *
  282. t #2 global.max$ substring$ 't :=
  283. }
  284. if$
  285. }
  286. while$
  287. }
  288. FUNCTION {format.date}
  289. { year empty$
  290. { month empty$
  291. { "" }
  292. { "there's a month but no year in " cite$ * warning$
  293. month parentheses
  294. }
  295. if$
  296. }
  297. { month empty$
  298. { year parentheses }
  299. { month " " * year * parentheses }
  300. if$
  301. }
  302. if$
  303. }
  304. FUNCTION {format.btitle}
  305. { title quote
  306. }
  307. FUNCTION {tie.or.space.connect}
  308. { duplicate$ text.length$ #3 <
  309. { "~" }
  310. { " " }
  311. if$
  312. swap$ * *
  313. }
  314. FUNCTION {either.or.check}
  315. { empty$
  316. 'pop$
  317. { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  318. if$
  319. }
  320. FUNCTION {format.bvolume}
  321. { volume empty$
  322. { "" }
  323. { "\abphrase{8}" volume tie.or.space.connect    
  324. series empty$
  325. 'skip$
  326. { "\abphrase{5}" * series quote * }    
  327. if$
  328. "volume and number" number either.or.check
  329. }
  330. if$
  331. }
  332. FUNCTION {format.number.series}
  333. { volume empty$
  334. { number empty$
  335. { series field.or.null }
  336. { output.state mid.sentence = output.state continue.sentence = or
  337. { "\abphrase{10}" }    
  338. { "\abphrase{11}" }    
  339. if$
  340. number tie.or.space.connect
  341. series empty$
  342. { "there's a number but no series in " cite$ * warning$ }
  343. { "\abphrase{6}" * series * }    
  344. if$
  345. }
  346. if$
  347. }
  348. { "" }
  349. if$
  350. }
  351. FUNCTION {format.edition}
  352. { edition empty$
  353. { "" }
  354. { output.state mid.sentence = output.state continue.sentence = or
  355. { edition "l" change.case$ "\abphrase{12}" * }    
  356. { edition "t" change.case$ "\abphrase{12}" * }    
  357. if$
  358. }
  359. if$
  360. }
  361. INTEGERS { multiresult }
  362. FUNCTION {multi.page.check}
  363. { 't :=
  364. #0 'multiresult :=
  365. { multiresult not
  366. t empty$ not
  367. and
  368. }
  369. { t #1 #1 substring$
  370. duplicate$ "-" =
  371. swap$ duplicate$ "," =
  372. swap$ "+" =
  373. or or
  374. { #1 'multiresult := }
  375. { t #2 global.max$ substring$ 't := }
  376. if$
  377. }
  378. while$
  379. multiresult
  380. }
  381. FUNCTION {format.pages}
  382. { pages empty$
  383. { "" }
  384. { pages multi.page.check
  385. { "\abphrase{13}" pages n.dashify tie.or.space.connect }    
  386. { "\abphrase{14}" pages tie.or.space.connect }            
  387. if$
  388. }
  389. if$
  390. }
  391. FUNCTION {format.vol.num.pages}
  392. { volume field.or.null boldface
  393. number empty$
  394. 'skip$
  395. { "\abtype{4}{" number * "}" * *    
  396. volume empty$
  397. { "there's a number but no volume in " cite$ * warning$ }
  398. 'skip$
  399. if$
  400. }
  401. if$
  402. pages empty$
  403. 'skip$
  404. { duplicate$ empty$
  405. { pop$ format.pages }
  406. { ", " * pages n.dashify * }
  407. if$
  408. }
  409. if$
  410. }
  411. FUNCTION {format.chapter.pages}
  412. { chapter empty$
  413. 'format.pages
  414. { type empty$
  415. { "\abphrase{15}" }    
  416. { type "l" change.case$ }
  417. if$
  418. chapter tie.or.space.connect
  419. pages empty$
  420. 'skip$
  421. { ", " * format.pages * }
  422. if$
  423. }
  424. if$
  425. }
  426. FUNCTION {format.in.ed.booktitle}
  427. { booktitle empty$
  428. { "" }
  429. { editor empty$
  430. { "\abphrase{7}" booktitle quote * }                
  431. { "\abphrase{7}" format.editors * ", " * booktitle quote * }    
  432. if$
  433. }
  434. if$
  435. }
  436. FUNCTION {empty.misc.check}
  437. { author empty$ title empty$ howpublished empty$
  438. month empty$ year empty$ note empty$
  439. and and and and and
  440. key empty$ not and
  441. { "all relevant fields are empty in " cite$ * warning$ }
  442. 'skip$
  443. if$
  444. }
  445. FUNCTION {format.thesis.type}
  446. { type empty$
  447. 'skip$
  448. { pop$
  449. type "t" change.case$
  450. }
  451. if$
  452. }
  453. FUNCTION {format.tr.number}
  454. { type empty$
  455. { "\abphrase{16}" }    
  456. 'type
  457. if$
  458. number empty$
  459. { "t" change.case$ }
  460. { number tie.or.space.connect }
  461. if$
  462. }
  463. FUNCTION {format.article.crossref}
  464. { key empty$
  465. { journal empty$
  466. { "need key or journal for " cite$ * " to crossref " * crossref *
  467. warning$
  468. ""
  469. }
  470. { "\abphrase{7}" journal emphasize * }    
  471. if$
  472. }
  473. { "\abphrase{7}" key * }    
  474. if$
  475. " \cite{" * crossref * "}" *
  476. }
  477. FUNCTION {format.crossref.editor}
  478. { editor #1 "{vv~}{ll}" format.name$
  479. editor num.names$ duplicate$
  480. #2 >
  481. { pop$ "\abphrase{2}" * }    
  482. { #2 <
  483. 'skip$
  484. { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  485. { "\abphrase{2}" * }                     
  486. { "\abphrase{0}" * editor #2 "{vv~}{ll}" format.name$ * } 
  487. if$
  488. }
  489. if$
  490. }
  491. if$
  492. }
  493. FUNCTION {format.book.crossref}
  494. { volume empty$
  495. { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  496. "\abphrase{7}"                
  497. }
  498. { "\abphrase{9}" volume tie.or.space.connect    
  499. "\abphrase{5}" *                
  500. }
  501. if$
  502. editor empty$
  503. editor field.or.null author field.or.null =
  504. or
  505. { key empty$
  506. { series empty$
  507. { "need editor, key, or series for " cite$ * " to crossref " *
  508. crossref * warning$
  509. "" *
  510. }
  511. { series quote * }
  512. if$
  513. }
  514. { key * }
  515. if$
  516. }
  517. { format.crossref.editor * }
  518. if$
  519. " \cite{" * crossref * "}" *
  520. }
  521. FUNCTION {format.incoll.inproc.crossref}
  522. { editor empty$
  523. editor field.or.null author field.or.null =
  524. or
  525. { key empty$
  526. { booktitle empty$
  527. { "need editor, key, or booktitle for " cite$ * " to crossref " *
  528. crossref * warning$
  529. ""
  530. }
  531. { "\abphrase{7}" booktitle quote * }    
  532. if$
  533. }
  534. { "\abphrase{7}" key * }    
  535. if$
  536. }
  537. { "\abphrase{7}" format.crossref.editor * }    
  538. if$
  539. " \cite{" * crossref * "}" *
  540. }
  541. FUNCTION {article}
  542. { output.bibitem
  543. format.authors "author" output.check
  544. new.block
  545. crossref missing$
  546. { journal emphasize "journal" output.check
  547. format.vol.num.pages output
  548. format.date "year" output.check
  549. }
  550. { format.article.crossref output.nonnull
  551. new.clause
  552. format.pages output
  553. }
  554. if$
  555. new.block
  556. note output
  557. fin.entry
  558. }
  559. FUNCTION {book}
  560. { output.bibitem
  561. author empty$
  562. { format.editors "author and editor" output.check }
  563. { format.authors output.nonnull
  564. crossref missing$
  565. { "author and editor" editor either.or.check }
  566. 'skip$
  567. if$
  568. }
  569. if$
  570. new.block
  571. format.btitle "title" output.check
  572. crossref missing$
  573. { new.clause
  574. format.bvolume output
  575. new.block
  576. format.number.series output
  577. new.sentence
  578. publisher "publisher" output.check
  579. address new.clause.checka
  580. address output
  581. }
  582. { new.block
  583. format.book.crossref output.nonnull
  584. }
  585. if$
  586. edition new.clause.checka
  587. format.edition output
  588. format.date "year" output.check
  589. new.block
  590. note output
  591. fin.entry
  592. }
  593. FUNCTION {booklet}
  594. { output.bibitem
  595. format.authors output
  596. new.block
  597. format.title "title" output.check
  598. howpublished address new.block.checkb
  599. howpublished output
  600. address new.clause.checka
  601. address output
  602. format.date output
  603. new.block
  604. note output
  605. fin.entry
  606. }
  607. FUNCTION {inbook}
  608. { output.bibitem
  609. author empty$
  610. { format.editors "author and editor" output.check }
  611. { format.authors output.nonnull
  612. crossref missing$
  613. { "author and editor" editor either.or.check }
  614. 'skip$
  615. if$
  616. }
  617. if$
  618. new.block
  619. format.btitle "title" output.check
  620. new.clause
  621. crossref missing$
  622. { format.bvolume output
  623. new.clause
  624. format.chapter.pages "chapter and pages" output.check
  625. new.block
  626. format.number.series output
  627. new.sentence
  628. publisher "publisher" output.check
  629. address new.clause.checka
  630. address output
  631. }
  632. { format.chapter.pages "chapter and pages" output.check
  633. new.block
  634. format.book.crossref output.nonnull
  635. }
  636. if$
  637. edition new.clause.checka
  638. format.edition output
  639. format.date "year" output.check
  640. new.block
  641. note output
  642. fin.entry
  643. }
  644. FUNCTION {incollection}
  645. { output.bibitem
  646. format.authors "author" output.check
  647. new.block
  648. chapter empty$ pages empty$ and
  649. {
  650. format.title "title" output.check
  651. new.block
  652. }
  653. 'skip$
  654. if$
  655. crossref missing$
  656. { format.in.ed.booktitle "booktitle" output.check
  657. new.clause
  658. format.bvolume output
  659. new.clause
  660. format.number.series output
  661. new.clause
  662. format.chapter.pages output
  663. new.sentence
  664. publisher "publisher" output.check
  665. address new.clause.checka
  666. address output
  667. edition new.clause.checka
  668. format.edition output
  669. format.date "year" output.check
  670. }
  671. { format.incoll.inproc.crossref output.nonnull
  672. new.clause
  673. format.chapter.pages output
  674. }
  675. if$
  676. new.block
  677. note output
  678. fin.entry
  679. }
  680. FUNCTION {inproceedings}
  681. { output.bibitem
  682. format.authors "author" output.check
  683. new.block
  684. pages empty$
  685. {
  686. format.title "title" output.check
  687. new.block
  688. }
  689. 'skip$
  690. if$
  691. crossref missing$
  692. { format.in.ed.booktitle "booktitle" output.check
  693. volume new.clause.checka
  694. format.bvolume output
  695. number series new.clause.checkb
  696. format.number.series output
  697. pages new.clause.checka
  698. format.pages output
  699. address empty$
  700. { organization publisher new.sentence.checkb
  701. organization output
  702. publisher new.clause.checka
  703. publisher output
  704. format.date "year" output.check
  705. }
  706. { new.clause
  707. address output.nonnull
  708. format.date "year" output.check
  709. new.sentence
  710. organization output
  711. new.clause
  712. publisher output
  713. }
  714. if$
  715. }
  716. { format.incoll.inproc.crossref output.nonnull
  717. new.clause
  718. format.pages output
  719. }
  720. if$
  721. new.block
  722. note output
  723. fin.entry
  724. }
  725. FUNCTION {conference} { inproceedings }
  726. FUNCTION {manual}
  727. { output.bibitem
  728. author empty$
  729. { organization empty$
  730. 'skip$
  731. { organization output.nonnull
  732. new.clause
  733. address output
  734. }
  735. if$
  736. }
  737. { format.authors output.nonnull }
  738. if$
  739. new.block
  740. format.btitle "title" output.check
  741. author empty$
  742. { organization empty$
  743. { address new.block.checka
  744. address output
  745. }
  746. 'skip$
  747. if$
  748. }
  749. { organization address new.block.checkb
  750. organization output
  751. address new.clause.checka
  752. address output
  753. }
  754. if$
  755. edition new.clause.checka
  756. format.edition output
  757. format.date output
  758. new.block
  759. note output
  760. fin.entry
  761. }
  762. FUNCTION {mastersthesis}
  763. { output.bibitem
  764. format.authors "author" output.check
  765. new.block
  766. format.title "title" output.check
  767. new.block
  768. "\abphrase{17}" format.thesis.type output.nonnull    
  769. new.clause
  770. school "school" output.check
  771. address new.clause.checka
  772. address output
  773. format.date "year" output.check
  774. new.block
  775. note output
  776. fin.entry
  777. }
  778. FUNCTION {misc}
  779. { output.bibitem
  780. format.authors output
  781. title howpublished new.block.checkb
  782. format.title output
  783. howpublished new.block.checka
  784. howpublished output
  785. format.date output
  786. new.block
  787. note output
  788. fin.entry
  789. empty.misc.check
  790. }
  791. FUNCTION {phdthesis}
  792. { output.bibitem
  793. format.authors "author" output.check
  794. new.block
  795. format.btitle "title" output.check
  796. new.block
  797. "\abphrase{18}" format.thesis.type output.nonnull    
  798. new.clause
  799. school "school" output.check
  800. address new.clause.checka
  801. address output
  802. format.date "year" output.check
  803. new.block
  804. note output
  805. fin.entry
  806. }
  807. FUNCTION {proceedings}
  808. { output.bibitem
  809. editor empty$
  810. { organization output }
  811. { format.editors output.nonnull }
  812. if$
  813. new.block
  814. format.btitle "title" output.check
  815. volume new.clause.checka
  816. format.bvolume output
  817. number series new.clause.checkb
  818. format.number.series output
  819. address empty$
  820. { editor empty$
  821. { publisher new.sentence.checka }
  822. { organization publisher new.sentence.checkb
  823. organization output
  824. publisher new.clause.checka
  825. }
  826. if$
  827. publisher output
  828. format.date "year" output.check
  829. }
  830. { new.clause
  831. address output.nonnull
  832. format.date "year" output.check
  833. new.sentence
  834. editor empty$
  835. 'skip$
  836. { organization output
  837. new.clause
  838. }
  839. if$
  840. publisher output
  841. }
  842. if$
  843. new.block
  844. note output
  845. fin.entry
  846. }
  847. FUNCTION {techreport}
  848. { output.bibitem
  849. format.authors "author" output.check
  850. new.block
  851. number empty$
  852. {
  853. format.title "title" output.check
  854. new.block
  855. }
  856. 'skip$
  857. if$
  858. format.tr.number output.nonnull
  859. new.clause
  860. institution "institution" output.check
  861. address new.clause.checka
  862. address output
  863. format.date "year" output.check
  864. new.block
  865. note output
  866. fin.entry
  867. }
  868. FUNCTION {unpublished}
  869. { output.bibitem
  870. format.authors "author" output.check
  871. new.block
  872. format.title "title" output.check
  873. new.block
  874. note "note" output.check
  875. format.date output
  876. fin.entry
  877. }
  878. FUNCTION {default.type} { misc }
  879. MACRO {jan} {"\abmonth{1}"}
  880. MACRO {feb} {"\abmonth{2}"}
  881. MACRO {mar} {"\abmonth{3}"}
  882. MACRO {apr} {"\abmonth{4}"}
  883. MACRO {may} {"\abmonth{5}"}
  884. MACRO {jun} {"\abmonth{6}"}
  885. MACRO {jul} {"\abmonth{7}"}
  886. MACRO {aug} {"\abmonth{8}"}
  887. MACRO {sep} {"\abmonth{9}"}
  888. MACRO {oct} {"\abmonth{10}"}
  889. MACRO {nov} {"\abmonth{11}"}
  890. MACRO {dec} {"\abmonth{12}"}
  891. MACRO {first}   {"\abedition{1}"}
  892. MACRO {second}  {"\abedition{2}"}
  893. MACRO {third}   {"\abedition{3}"}
  894. MACRO {fourth}  {"\abedition{4}"}
  895. MACRO {fifth}   {"\abedition{5}"}
  896. MACRO {sixth}   {"\abedition{6}"}
  897. MACRO {seventh} {"\abedition{7}"}
  898. MACRO {eighth}  {"\abedition{8}"}
  899. MACRO {ninth}   {"\abedition{9}"}
  900. MACRO {tenth}   {"\abedition{10}"}
  901. MACRO {section}   {"\abchapter{0}"}
  902. MACRO {paragraph} {"\abchapter{1}"}
  903. MACRO {appendix}  {"\abchapter{2}"}
  904. MACRO {part}      {"\abchapter{3}"}
  905. READ
  906. FUNCTION {sortify}
  907. { purify$
  908. "l" change.case$
  909. }
  910. INTEGERS { len }
  911. FUNCTION {chop.word}
  912. { 's :=
  913. 'len :=
  914. s #1 len substring$ =
  915. { s len #1 + global.max$ substring$ }
  916. 's
  917. if$
  918. }
  919. FUNCTION {sort.format.names}
  920. { 's :=
  921. #1 'nameptr :=
  922. ""
  923. s num.names$ 'numnames :=
  924. numnames 'namesleft :=
  925. { namesleft #0 > }
  926. { nameptr #1 >
  927. { "   " * }
  928. 'skip$
  929. if$
  930. s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't :=
  931. nameptr numnames = t "others" = and
  932. { "et al" * }
  933. { t sortify * }
  934. if$
  935. nameptr #1 + 'nameptr :=
  936. namesleft #1 - 'namesleft :=
  937. }
  938. while$
  939. }
  940. FUNCTION {sort.format.title}
  941. { 't :=
  942. "A " #2
  943. "An " #3
  944. "The " #4 t chop.word
  945. chop.word
  946. chop.word
  947. sortify
  948. #1 global.max$ substring$
  949. }
  950. FUNCTION {author.sort}
  951. { author empty$
  952. { key empty$
  953. { "to sort, need author or key in " cite$ * warning$
  954. ""
  955. }
  956. { key sortify }
  957. if$
  958. }
  959. { author sort.format.names }
  960. if$
  961. }
  962. FUNCTION {author.editor.sort}
  963. { author empty$
  964. { editor empty$
  965. { key empty$
  966. { "to sort, need author, editor, or key in " cite$ * warning$
  967. ""
  968. }
  969. { key sortify }
  970. if$
  971. }
  972. { editor sort.format.names }
  973. if$
  974. }
  975. { author sort.format.names }
  976. if$
  977. }
  978. FUNCTION {author.organization.sort}
  979. { author empty$
  980. { organization empty$
  981. { key empty$
  982. { "to sort, need author, organization, or key in " cite$ * warning$
  983. ""
  984. }
  985. { key sortify }
  986. if$
  987. }
  988. { "The " #4 organization chop.word sortify }
  989. if$
  990. }
  991. { author sort.format.names }
  992. if$
  993. }
  994. FUNCTION {editor.organization.sort}
  995. { editor empty$
  996. { organization empty$
  997. { key empty$
  998. { "to sort, need editor, organization, or key in " cite$ * warning$
  999. ""
  1000. }
  1001. { key sortify }
  1002. if$
  1003. }
  1004. { "The " #4 organization chop.word sortify }
  1005. if$
  1006. }
  1007. { editor sort.format.names }
  1008. if$
  1009. }
  1010. FUNCTION {presort}
  1011. { type$ "book" =
  1012. type$ "inbook" =
  1013. or
  1014. 'author.editor.sort
  1015. { type$ "proceedings" =
  1016. 'editor.organization.sort
  1017. { type$ "manual" =
  1018. 'author.organization.sort
  1019. 'author.sort
  1020. if$
  1021. }
  1022. if$
  1023. }
  1024. if$
  1025. "    "
  1026. *
  1027. year field.or.null sortify
  1028. *
  1029. "    "
  1030. *
  1031. title field.or.null
  1032. sort.format.title
  1033. *
  1034. #1 entry.max$ substring$
  1035. 'sort.key$ :=
  1036. }
  1037. ITERATE {presort}
  1038. SORT
  1039. STRINGS { longest.label }
  1040. INTEGERS { number.label longest.label.width }
  1041. FUNCTION {initialize.longest.label}
  1042. { "" 'longest.label :=
  1043. #1 'number.label :=
  1044. #0 'longest.label.width :=
  1045. }
  1046. FUNCTION {longest.label.pass}
  1047. { number.label int.to.str$ 'label :=
  1048. number.label #1 + 'number.label :=
  1049. label width$ longest.label.width >
  1050. { label 'longest.label :=
  1051. label width$ 'longest.label.width :=
  1052. }
  1053. 'skip$
  1054. if$
  1055. }
  1056. EXECUTE {initialize.longest.label}
  1057. ITERATE {longest.label.pass}
  1058. FUNCTION {begin.bib}
  1059. {
  1060. "\newif\ifabfull\abfullfalse" write$ newline$
  1061. preamble$ empty$
  1062. 'skip$
  1063. { preamble$ write$ newline$ }
  1064. if$
  1065. "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1066. }
  1067. EXECUTE {begin.bib}
  1068. EXECUTE {init.state.consts}
  1069. ITERATE {call.type$}
  1070. FUNCTION {end.bib}
  1071. { newline$
  1072. "\end{thebibliography}" write$ newline$
  1073. }
  1074. EXECUTE {end.bib}
  1075.